#include "Rom.h"

struct Color {
  uint r, g, b;
};

uint userStrToSnesAddr(const char* str, std::map<std::string, int> &labels);

uint toRegPointer(uint ptr);
uint toSnesPointer(uint ptr);
char toRegChar(uchar c);
uchar toGameChar(char c);
void toRegString(char* str);
void readRegString(Rom &rom, char* regStr, int len);
void writeRegString(Rom &rom, char* regStr, int len);

void read2BppImage(uchar* data, uchar* image, int x, int y, int w, int bitOffset);
void read4BppImage(uchar* data, uchar* image, int x, int y, int w, int bitOffset);
void read4BppImage(uchar* data, uchar* image, int bitOffset);
void write2BppImage(uchar* image, uchar* data, int x, int y, int w, int bitOffset);
void write4BppImage(uchar* image, uchar* data, int x, int y, int w, int bitOffset);
void write4BppImage(uchar* image, uchar* data, int bitOffset);

bool writeToFree(Rom &rom, uchar* data, uint dataLen, uint pointerLoc, uint pointerLen);
